home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / findphoto.z / findphoto
Text File  |  1998-10-30  |  16KB  |  265 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))                                            TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage,
  10.      Tk_PhotoBlank, Tk_PhotoExpand, Tk_PhotoGetSize, Tk_PhotoSetSize -
  11.      manipulate the image data stored in a photo image.
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkkPPPPhhhhoooottttoooo....hhhh>>>>
  16.  
  17.      Tk_PhotoHandle
  18.      TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo(_i_m_a_g_e_N_a_m_e)
  19.  
  20.      void
  21.      TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk(_h_a_n_d_l_e, _b_l_o_c_k_P_t_r, _x, _y, _w_i_d_t_h, _h_e_i_g_h_t)
  22.  
  23.      void
  24.      TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttZZZZoooooooommmmeeeeddddBBBBlllloooocccckkkk(_h_a_n_d_l_e, _b_l_o_c_k_P_t_r, _x, _y, _w_i_d_t_h, _h_e_i_g_h_t,_z_o_o_m_X, _z_o_o_m_Y, _s_u_b_s_a_m_p_l_e_X, _s_u_b_s_a_m_p_l_e_Y)
  25.  
  26.      int
  27.      TTTTkkkk____PPPPhhhhoooottttooooGGGGeeeettttIIIImmmmaaaaggggeeee(_h_a_n_d_l_e, _b_l_o_c_k_P_t_r)
  28.  
  29.      void
  30.      TTTTkkkk____PPPPhhhhoooottttooooBBBBllllaaaannnnkkkk(_h_a_n_d_l_e)
  31.  
  32.      void
  33.      TTTTkkkk____PPPPhhhhoooottttooooEEEExxxxppppaaaannnndddd(_h_a_n_d_l_e, _w_i_d_t_h, _h_e_i_g_h_t)
  34.  
  35.      void
  36.      TTTTkkkk____PPPPhhhhoooottttooooGGGGeeeettttSSSSiiiizzzzeeee(_h_a_n_d_l_e, _w_i_d_t_h_P_t_r, _h_e_i_g_h_t_P_t_r)
  37.  
  38.      void
  39.      TTTTkkkk____PPPPhhhhoooottttooooSSSSeeeettttSSSSiiiizzzzeeee(_h_a_n_d_l_e, _w_i_d_t_h, _h_e_i_g_h_t)
  40.  
  41. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  42.      char                 *_i_m_a_g_e_N_a_m_e    (in)      Name of the photo image.
  43.  
  44.      Tk_PhotoHandle       _h_a_n_d_l_e        (in)      Opaque handle identifying
  45.                                                   the photo image to be
  46.                                                   affected.
  47.  
  48.      Tk_PhotoImageBlock   *_b_l_o_c_k_P_t_r     (in)      Specifies the address and
  49.                                                   storage layout of image
  50.                                                   data.
  51.  
  52.      int                  _x             (in)      Specifies the X coordinate
  53.                                                   where the top-left corner of
  54.                                                   the block is to be placed
  55.                                                   within the image.
  56.  
  57.      int                  _y             (in)      Specifies the Y coordinate
  58.                                                   where the top-left corner of
  59.                                                   the block is to be placed
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))                                            TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.                                                   within the image.
  75.  
  76.      int                  _w_i_d_t_h         (in)      Specifies the width of the
  77.                                                   image area to be affected
  78.                                                   (for TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk) or
  79.                                                   the desired image width (for
  80.                                                   TTTTkkkk____PPPPhhhhoooottttooooEEEExxxxppppaaaannnndddd and
  81.                                                   TTTTkkkk____PPPPhhhhoooottttooooSSSSeeeettttSSSSiiiizzzzeeee).
  82.  
  83.      int                  _h_e_i_g_h_t        (in)      Specifies the height of the
  84.                                                   image area to be affected
  85.                                                   (for TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk) or
  86.                                                   the desired image height
  87.                                                   (for TTTTkkkk____PPPPhhhhoooottttooooEEEExxxxppppaaaannnndddd and
  88.                                                   TTTTkkkk____PPPPhhhhoooottttooooSSSSeeeettttSSSSiiiizzzzeeee).
  89.  
  90.      int                  *_w_i_d_t_h_P_t_r     (out)     Pointer to location in which
  91.                                                   to store the image width.
  92.  
  93.      int                  *_h_e_i_g_h_t_P_t_r    (out)     Pointer to location in which
  94.                                                   to store the image height.
  95.  
  96.      int                  _s_u_b_s_a_m_p_l_e_X    (in)      Specifies the subsampling
  97.                                                   factor in the X direction
  98.                                                   for input image data.
  99.  
  100.      int                  _s_u_b_s_a_m_p_l_e_Y    (in)      Specifies the subsampling
  101.                                                   factor in the Y direction
  102.                                                   for input image data.
  103.  
  104.      int                  _z_o_o_m_X         (in)      Specifies the zoom factor to
  105.                                                   be applied in the X
  106.                                                   direction to pixels being
  107.                                                   written to the photo image.
  108.  
  109.      int                  _z_o_o_m_Y         (in)      Specifies the zoom factor to
  110.                                                   be applied in the Y
  111.                                                   direction to pixels being
  112.                                                   written to the photo image.
  113.  
  114.  
  115. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  116.      TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo returns an opaque handle that is used to identify a
  117.      particular photo image to the other procedures.  The parameter is the
  118.      name of the image, that is, the name specified to the iiiimmmmaaaaggggeeee ccccrrrreeeeaaaatttteeee pppphhhhoooottttoooo
  119.      command, or assigned by that command if no name was specified.
  120.  
  121.      TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk is used to supply blocks of image data to be displayed.
  122.      The call affects an area of the image of size _w_i_d_t_h x _h_e_i_g_h_t pixels, with
  123.      its top-left corner at coordinates (_x,_y).  All of _w_i_d_t_h, _h_e_i_g_h_t, _x, and _y
  124.      must be non-negative.  If part of this area lies outside the current
  125.      bounds of the image, the image will be expanded to include the area,
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))                                            TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      unless the user has specified an explicit image size with the ----wwwwiiiiddddtttthhhh
  141.      and/or ----hhhheeeeiiiigggghhhhtttt widget configuration options (see photo(n)); in that case
  142.      the area is silently clipped to the image boundaries.
  143.  
  144.      The _b_l_o_c_k parameter is a pointer to a TTTTkkkk____PPPPhhhhoooottttooooIIIImmmmaaaaggggeeeeBBBBlllloooocccckkkk structure,
  145.      defined as follows:
  146.           ttttyyyyppppeeeeddddeeeeffff ssssttttrrrruuuucccctttt {
  147.                uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr *_p_i_x_e_l_P_t_r;
  148.                iiiinnnntttt _w_i_d_t_h;
  149.                iiiinnnntttt _h_e_i_g_h_t;
  150.                iiiinnnntttt _p_i_t_c_h;
  151.                iiiinnnntttt _p_i_x_e_l_S_i_z_e;
  152.                iiiinnnntttt _o_f_f_s_e_t[_3];
  153.           } TTTTkkkk____PPPPhhhhoooottttooooIIIImmmmaaaaggggeeeeBBBBlllloooocccckkkk;;;;
  154.  
  155.      The _p_i_x_e_l_P_t_r field points to the first pixel, that is, the top-left pixel
  156.      in the block.  The _w_i_d_t_h and _h_e_i_g_h_t fields specify the dimensions of the
  157.      block of pixels.  The _p_i_x_e_l_S_i_z_e field specifies the address difference
  158.      between two horizontally adjacent pixels.  Often it is 3 or 4, but it can
  159.      have any value.  The _p_i_t_c_h field specifies the address difference between
  160.      two vertically adjacent pixels.  The _o_f_f_s_e_t array contains the offsets
  161.      from the address of a pixel to the addresses of the bytes containing the
  162.      red, green and blue components.  These are normally 0, 1 and 2, but can
  163.      have other values, e.g., for images that are stored as separate red,
  164.      green and blue planes.
  165.  
  166.      The value given for the _w_i_d_t_h and _h_e_i_g_h_t parameters to TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk
  167.      do not have to correspond to the values specified in _b_l_o_c_k.  If they are
  168.      smaller, TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk extracts a sub-block from the image data
  169.      supplied.  If they are larger, the data given are replicated (in a tiled
  170.      fashion) to fill the specified area.  These rules operate independently
  171.      in the horizontal and vertical directions.
  172.  
  173.      TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttZZZZoooooooommmmeeeeddddBBBBlllloooocccckkkk works like TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk except that the image
  174.      can be reduced or enlarged for display.  The _s_u_b_s_a_m_p_l_e_X and _s_u_b_s_a_m_p_l_e_Y
  175.      parameters allow the size of the image to be reduced by subsampling.
  176.      TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttZZZZoooooooommmmeeeeddddBBBBlllloooocccckkkk will use only pixels from the input image whose X
  177.      coordinates are multiples of _s_u_b_s_a_m_p_l_e_X, and whose Y coordinates are
  178.      multiples of _s_u_b_s_a_m_p_l_e_Y.  For example, an image of 512x512 pixels can be
  179.      reduced to 256x256 by setting _s_u_b_s_a_m_p_l_e_X and _s_u_b_s_a_m_p_l_e_Y to 2.
  180.  
  181.      The _z_o_o_m_X and _z_o_o_m_Y parameters allow the image to be enlarged by pixel
  182.      replication.  Each pixel of the (possibly subsampled) input image will be
  183.      written to a block _z_o_o_m_X pixels wide and _z_o_o_m_Y pixels high of the
  184.      displayed image.  Subsampling and zooming can be used together for
  185.      special effects.
  186.  
  187.      TTTTkkkk____PPPPhhhhoooottttooooGGGGeeeettttIIIImmmmaaaaggggeeee can be used to retrieve image data from a photo image.
  188.      TTTTkkkk____PPPPhhhhoooottttooooGGGGeeeettttIIIImmmmaaaaggggeeee fills in the structure pointed to by the _b_l_o_c_k_P_t_r
  189.      parameter with values that describe the address and layout of the image
  190.      data that the photo image has stored internally.  The values are valid
  191.      until the image is destroyed or its size is changed.  TTTTkkkk____PPPPhhhhoooottttooooGGGGeeeettttIIIImmmmaaaaggggeeee
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))                                            TTTTkkkk____FFFFiiiinnnnddddPPPPhhhhoooottttoooo((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206.      returns 1 for compatibility with the corresponding procedure in the old
  207.      photo widget.
  208.  
  209.      TTTTkkkk____PPPPhhhhoooottttooooBBBBllllaaaannnnkkkk blanks the entire area of the photo image.  Blank areas of
  210.      a photo image are transparent.
  211.  
  212.      TTTTkkkk____PPPPhhhhoooottttooooEEEExxxxppppaaaannnndddd requests that the widget's image be expanded to be at
  213.      least _w_i_d_t_h x _h_e_i_g_h_t pixels in size.  The width and/or height are
  214.      unchanged if the user has specified an explicit image width or height
  215.      with the ----wwwwiiiiddddtttthhhh and/or ----hhhheeeeiiiigggghhhhtttt configuration options, respectively.  If
  216.      the image data are being supplied in many small blocks, it is more
  217.      efficient to use TTTTkkkk____PPPPhhhhoooottttooooEEEExxxxppppaaaannnndddd or TTTTkkkk____PPPPhhhhoooottttooooSSSSeeeettttSSSSiiiizzzzeeee at the beginning
  218.      rather than allowing the image to expand in many small increments as
  219.      image blocks are supplied.
  220.  
  221.      TTTTkkkk____PPPPhhhhoooottttooooSSSSeeeettttSSSSiiiizzzzeeee specifies the size of the image, as if the user had
  222.      specified the given _w_i_d_t_h and _h_e_i_g_h_t values to the ----wwwwiiiiddddtttthhhh and ----hhhheeeeiiiigggghhhhtttt
  223.      configuration options.  A value of zero for _w_i_d_t_h or _h_e_i_g_h_t does not
  224.      change the image's width or height, but allows the width or height to be
  225.      changed by subsequent calls to TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttBBBBlllloooocccckkkk, TTTTkkkk____PPPPhhhhoooottttooooPPPPuuuuttttZZZZoooooooommmmeeeeddddBBBBlllloooocccckkkk
  226.      or TTTTkkkk____PPPPhhhhoooottttooooEEEExxxxppppaaaannnndddd.
  227.  
  228.      TTTTkkkk____PPPPhhhhoooottttooooGGGGeeeettttSSSSiiiizzzzeeee returns the dimensions of the image in *_w_i_d_t_h_P_t_r and
  229.      *_h_e_i_g_h_t_P_t_r.
  230.  
  231.  
  232. CCCCRRRREEEEDDDDIIIITTTTSSSS
  233.      The code for the photo image type was developed by Paul Mackerras, based
  234.      on his earlier photo widget code.
  235.  
  236.  
  237. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  238.      photo, image
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.